import request from '@/utils/request'

// 获取工程对应的
export function getengineerProject(id) {
  return request({
    url: `/engineering/engineering/getAllProject/${id}`,
    method: 'get',
  })
}

// 查询企业信息列表
export function listEnterprise2(query) {
  return request({
    url: '/admin/enterprise/list',
    method: 'get',
    params: query
  })
}

// 查询企业信息列表（全部）
export function listEnterpriseAll(data) {
  return request({
    url: '/admin/enterprise/listAll',
    method: 'get',
    params: data
  })
}
//添加企业信息列表
export function addEnterprise1(data) {
  return request({
    url: '/admin/enterprise',
    method: 'post',
     data: data
  })
}
//修改企业信息列表
export function updateEnterprise(data) {
  return request({
    url: '/admin/enterprise',
    method: 'put',
    data: data
  })
}
// 委托单管理列表
export function listEnterprise(query) {
  return request({
    url: '/commission/commission/list',
    method: 'get',
    params: query
  })
}

// 查询企业信息详细
export function getEnterprise(id) {
  return request({
    url: '/admin/enterprise/' + id,
    method: 'get'
  })
}

// 委托单填报
export function addEnterprise(data) {
  return request({
    url: '/commission/commission',
    method: 'post',
    data: data
  })
}
//commission/commission委托单修改
export function updateEnterprise1(data) {
  return request({
    url: '/commission/commission',
    method: 'put',
    data: data
  })
}
//委托单管理单条
export function geteditEnterprise(id) {
  return request({
    url: '/commission/commission/' + id,
    method: 'get'
  })
}
//委托单受理
export function acceptanceOrder(data) {
  return request({
    url: '/commission/commission/acceptance',
    method: 'post',
    data: data
  })
}
//上传附表
export function uploadTable(data) {
  return request({
    url: '/attached/attached/typeAdd',
    method: 'post',
    data: data
  })
}
// 删除附表
export function delAttached(id) {
  return request({
    url: '/attached/attached/' + id,
    method: 'delete'
  })
}

//工程信息查询
export function searchProject(query) {
  return request({
    url: '/engineering/engineering/listAll',
    method: 'get',
    params: query
  })
}
//工程信息列表查询
export function ProjectList(query) {
  return request({
    url: '/engineering/engineering/list',
    method: 'get',
    params: query
  })
}

//工程信息单条查询
export function ProjectSingleList(id) {
  return request({
    url: '/engineering/engineering/' + id,
    method: 'get',
  })
}
///report/report/list检测项目列表
export function getSampleList(query) {
  return request({
    url: '/sample/sample/list',
    method: 'get',
     params: query
  })
}
//sample/sample检测项目添加
export function addSampleList(data) {
  return request({
    url: '/sample/sample',
    method: 'post',
    data: data
  })
}
// 修改检测项目
export function updateSampleList(data) {
  return request({
    url: '/sample/sample',
    method: 'put',
    data: data
  })
}
// 删除检测项目
export function delSampleList(id) {
  return request({
    url: '/sample/sample/' + id,
    method: 'delete'
  })
}
//sample/sample查询检测项目单条
export function getSampleListdt(id) {
  return request({
    url: '/sample/sample/' + id,
    method: 'get'
  })
}
//attached/attached/list附表管理
export function getAttachedList(query) {
  return request({
    url: '/attached/attached/list',
    method: 'get',
     params: query
  })
}
//报告管理列表
export function getReportList(query) {
  return request({
    url: '/report/report/list',
    method: 'get',
     params: query
  })
}
//新增报告
export function addReport(data) {
  return request({
    url: '/report/report',
    method: 'post',
    data: data
  })
}
//修改报告
export function updateReport(data) {
  return request({
    url: '/report/report',
    method: 'put',
    data: data
  })
}
//删除报告
export function delReport(id) {
  return request({
    url: '/report/report/' + id,
    method: 'delete',

  })
}
//查询报告单条
export function getReportListdt(id) {
  return request({
    url: '/report/report/' + id,
    method: 'get'
  })
}
//附表详情
export function getAttachedDetail(id) {
  return request({
    url: '/attached/attached/' + id,
    method: 'get'
  })
}
// 删除企业信息
export function delEnterprise(id) {
  return request({
    url: '/admin/enterprise/' + id,
    method: 'delete'
  })
}
// 删除企业信息
export function logicDelEnterprise(id) {
  return request({
    url: '/admin/enterprise/' + id,
    method: 'delete'
  })
}
// 删除委托单
export function DelEnterpriselist(id) {
  return request({
    url: '/commission/commission/' + id,
    method: 'delete'
  })
}

// 导出企业信息
export function exportEnterprise(query) {
  return request({
    url: '/admin/enterprise/export',
    method: 'get',
    params: query
  })
}
// 获取系统参数设置
export function getSystemset(query) {
  return request({
    url: '/system/config/configKey/gc_commission_code',
    method: 'get',
    params: query
  })
}
// 删除附表
export function Delattachedlist(id) {
  return request({
    url: '/attached/attached/' + id,
    method: 'delete'
  })
}

//消息新增
export function insertNotice(data) {
  return request({
    url: '/notice/notice',
    method: 'post',
    data: data
  })
}
// 查询室外项目列表
export function getAttachedData(query) {
  return request({
    url: '/attachedData/attachedData/list',
    method: 'get',
    params: query
  })
}

//室外项目新增
export function addAttachedData(data) {
  return request({
    url: '/attachedData/attachedData',
    method: 'post',
    data: data
  })
}
// 删除室外表格
export function DelAttachedDatalist(id) {
  return request({
    url: '/attachedData/attachedData/' + id,
    method: 'delete'
  })
}
// 查询室外详情详细
export function getAttachedDatadetail(id) {
  return request({
    url: '/attachedData/attachedData/' + id,
    method: 'get'
  })
}
//室外表格修改
export function updateAttachedData(data) {
  return request({
    url: '/attachedData/attachedData',
    method: 'put',
    data: data
  })
}
//获取项目检测方法
export function getDetectionContentChange(data) {
  return request({
    url: '/commission/commission/getDetectionContentChange?commissionId='+data.commissionId+"&businessType="+data.businessType,
    method: 'post',
    // data: data
  })
}
